﻿using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;

namespace XiaF.Ioc
{
    public static class ServiceResolve
    {
        private static Dictionary<string, Type> viewDic = new Dictionary<string, Type>();

        public static object? GetView(Type type)
        {
            if(!viewDic.ContainsKey(nameof(type)))
                Exception.ThrowInvalidOperationExceptionForUnregisteredType();
           
        }

        public static object? GetView(string name)
        {
            if (!viewDic.ContainsKey(name))
                Exception.ThrowInvalidOperationExceptionForUnregisteredType();
            return viewDic[name].ViewType;
        }
    }
}
